Feature: MPEG-TS Streaming via SRT, TCP, and UDP (--stream-sink)#6721
Open
yeicor wants to merge 11 commits intoGenymobile:masterfrom
Open
Feature: MPEG-TS Streaming via SRT, TCP, and UDP (--stream-sink)#6721yeicor wants to merge 11 commits intoGenymobile:masterfrom
--stream-sink)#6721yeicor wants to merge 11 commits intoGenymobile:masterfrom
Conversation
Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
…sertion with --no-playback Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
Remove automatic SRT latency=50 injection and simplify CLI help. Avoid calling avio_close() for srt:// to work around SRT/FFmpeg epoll deadlocks; other protocols are closed normally. Treat udp:// as connectionless and use a single output stream instead of accepting per-client threads
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “stream sink” output path to stream the device’s video/audio as MPEG-TS over a user-provided URL, integrating it into scrcpy’s CLI/options and packet pipeline.
Changes:
- Add a new
sc_stream_sinkcomponent (stream_sink.c/.h) implementingsc_packet_sinkfor video/audio and handling client connections/output streaming. - Wire the stream sink into
scrcpy.cinitialization/cleanup and expose it via a new--stream-sinkCLI option plusscrcpy_options.stream_sink. - Increase
SC_PACKET_SOURCE_MAX_SINKSto allow one more packet sink.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/trait/packet_source.h | Increase max packet sinks to allow adding the new stream sink. |
| app/src/stream_sink.h | New public interface/type definitions for the stream sink component. |
| app/src/stream_sink.c | New streaming implementation: URL handling, template ctx setup, client threads, fan-out queues. |
| app/src/scrcpy.c | Initialize/start/stop/join/destroy the stream sink and add it as a packet sink. |
| app/src/options.h | Add stream_sink option field. |
| app/src/options.c | Default stream_sink to NULL. |
| app/src/cli.c | Add --stream-sink CLI flag and adjust auto-disable logic for video/audio. |
| app/meson.build | Build the new stream_sink.c source file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds a new
--stream-sinkoption to scrcpy, allowing you to stream device video and audio as MPEG-TS to a URL using SRT, TCP, or UDP protocols. This is especially useful for integrating scrcpy with tools like OBS or other streaming clients on any OS, so it closes #467 and #5796.Example Usage
Additional Context